﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using A2DFramework.PipelineEngine;

namespace PETest
{
    class Program
    {
        static void Main(string[] args)
        {
            BO bo = new BO();

            Pipeline<string, bool> p = Pipeline.Wrap<string, bool>(bo.Add).BeforeExecute(m => Console.WriteLine("before execute"))
                                                                          .AfterExecute((m, n) => Console.WriteLine("after execute1"))
                                                                          .AfterExecute((m, n) => Console.WriteLine("after execute2"))
                                                                          .Success((m, n) => Console.WriteLine("success"))
                                                                          .Fail((m, n) => Console.WriteLine("fail"))
                                                                          .Final((m, n) => Console.WriteLine("final"));


            Console.WriteLine("Result: " + p.Execute("testing").Result);

            Console.WriteLine();
            Console.WriteLine();

            Console.WriteLine("Result: " + p.Execute(null).Result);

            Console.ReadKey();
        }
    }
}
